{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Define Dependencies"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n",
      "/anaconda3/envs/benchmarking/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_qint8 = np.dtype([(\"qint8\", np.int8, 1)])\n",
      "/anaconda3/envs/benchmarking/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_quint8 = np.dtype([(\"quint8\", np.uint8, 1)])\n",
      "/anaconda3/envs/benchmarking/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:528: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_qint16 = np.dtype([(\"qint16\", np.int16, 1)])\n",
      "/anaconda3/envs/benchmarking/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:529: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_quint16 = np.dtype([(\"quint16\", np.uint16, 1)])\n",
      "/anaconda3/envs/benchmarking/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:530: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_qint32 = np.dtype([(\"qint32\", np.int32, 1)])\n",
      "/anaconda3/envs/benchmarking/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:535: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  np_resource = np.dtype([(\"resource\", np.ubyte, 1)])\n"
     ]
    }
   ],
   "source": [
    "# Import the necessary libraries\n",
    "from sklearn.decomposition import PCA\n",
    "import os\n",
    "import scipy.io as sio\n",
    "import numpy as np\n",
    "from keras.models import load_model\n",
    "from keras.utils import np_utils\n",
    "from sklearn.metrics import classification_report, confusion_matrix\n",
    "import itertools\n",
    "import spectral\n",
    "import matplotlib\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Load the Global values (windowSize, numPCAcomponents, testRatio) from the text file global_variables.txt\n",
    "myFile = open('global_variables.txt', 'r') \n",
    "file = myFile.readlines()[:]\n",
    "\n",
    "\n",
    "for line in file:\n",
    "\n",
    "    if line[0:3] == \"win\":\n",
    "\n",
    "        ds = line.find('=')\n",
    "        windowSize = int(line[ds+1:-1],10)\n",
    "\n",
    "    elif line[0:3] == \"num\":\n",
    "\n",
    "        ds = line.find('=')\n",
    "        numPCAcomponents = int(line[ds+2:-1],10)\n",
    "\n",
    "    else:\n",
    "\n",
    "        ds = line.find('=')\n",
    "        testRatio = float(line[ds+1:])\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Define the neccesary functions for later use"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "def loadIndianPinesData():\n",
    "    data_path = os.path.join(os.getcwd(),'Data')\n",
    "    data = sio.loadmat(os.path.join(data_path, 'Indian_pines_corrected.mat'))['indian_pines_corrected']\n",
    "    labels = sio.loadmat(os.path.join(data_path, 'Indian_pines_gt.mat'))['indian_pines_gt']\n",
    "    \n",
    "    return data, labels\n",
    "\n",
    "def reports (X_test,y_test):\n",
    "    Y_pred = model.predict(X_test)\n",
    "    y_pred = np.argmax(Y_pred, axis=1)\n",
    "    target_names = ['Alfalfa', 'Corn-notill', 'Corn-mintill', 'Corn'\n",
    "               ,'Grass-pasture', 'Grass-trees', 'Grass-pasture-mowed', \n",
    "                'Hay-windrowed', 'Oats', 'Soybean-notill', 'Soybean-mintill',\n",
    "               'Soybean-clean', 'Wheat', 'Woods', 'Buildings-Grass-Trees-Drives',\n",
    "               'Stone-Steel-Towers']\n",
    "\n",
    "    \n",
    "    classification = classification_report(np.argmax(y_test, axis=1), y_pred, target_names=target_names)\n",
    "    confusion = confusion_matrix(np.argmax(y_test, axis=1), y_pred)\n",
    "    score = model.evaluate(X_test, y_test, batch_size=32)\n",
    "    Test_Loss =  score[0]*100\n",
    "    Test_accuracy = score[1]*100\n",
    "    \n",
    "    return classification, confusion, Test_Loss, Test_accuracy\n",
    "\n",
    "\n",
    "def applyPCA(X, numPCAcomponents=75):\n",
    "    newX = np.reshape(X, (-1, X.shape[2]))\n",
    "    pca = PCA(n_components=numPCAcomponents, whiten=True)\n",
    "    newX = pca.fit_transform(newX)\n",
    "    newX = np.reshape(newX, (X.shape[0],X.shape[1], numPCAcomponents))\n",
    "    return newX, pca\n",
    "\n",
    "def Patch(data,height_index,width_index):\n",
    "    #transpose_array = data.transpose((2,0,1))\n",
    "    #print transpose_array.shape\n",
    "    height_slice = slice(height_index, height_index+PATCH_SIZE)\n",
    "    width_slice = slice(width_index, width_index+PATCH_SIZE)\n",
    "    patch = data[height_slice, width_slice, :]\n",
    "    \n",
    "    return patch"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "X_test = np.load(\"X_testPatches_\" + str(windowSize) + \"PCA\" + str(numPCAcomponents) + \"testRatio\" + str(testRatio) + \".npy\")\n",
    "\n",
    "\n",
    "y_test = np.load(\"y_testPatches_\" + str(windowSize) + \"PCA\" + str(numPCAcomponents) + \"testRatio\" + str(testRatio) + \".npy\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "X_test  = np.reshape(X_test, (X_test.shape[0], X_test.shape[3], X_test.shape[1], X_test.shape[2]))\n",
    "y_test = np_utils.to_categorical(y_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "# load the model architecture and weights\n",
    "model = load_model('my_model' + str(windowSize) + 'PCA' + str(numPCAcomponents) + \"testRatio\" + str(testRatio) + '.h5')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2563/2563 [==============================] - 0s 112us/step\n"
     ]
    }
   ],
   "source": [
    "# Using the pretrained model make predictions and print the results into a report\n",
    "classification, confusion, Test_loss, Test_accuracy = reports(X_test,y_test)\n",
    "classification = str(classification)\n",
    "confusion = str(confusion)\n",
    "file_name = 'report' + \"WindowSize\" + str(windowSize) + \"PCA\" + str(numPCAcomponents) + \"testRatio\" + str(testRatio) +\".txt\"\n",
    "with open(file_name, 'w') as x_file:\n",
    "    x_file.write('{} Test loss (%)'.format(Test_loss))\n",
    "    x_file.write('\\n')\n",
    "    x_file.write('{} Test accuracy (%)'.format(Test_accuracy))\n",
    "    x_file.write('\\n')\n",
    "    x_file.write('\\n')\n",
    "    x_file.write('{}'.format(classification))\n",
    "    x_file.write('\\n')\n",
    "    x_file.write('{}'.format(confusion))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Build the Classification Maps"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "# load the original image\n",
    "X, y = loadIndianPinesData()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "X,pca = applyPCA(X,numPCAcomponents)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": [
    "height = y.shape[0]\n",
    "width = y.shape[1]\n",
    "PATCH_SIZE = windowSize\n",
    "numPCAcomponents = numPCAcomponents"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "# calculate the predicted image\n",
    "outputs = np.zeros((height,width))\n",
    "for i in range(height-PATCH_SIZE+1):\n",
    "    for j in range(width-PATCH_SIZE+1):\n",
    "        target = y[int(i+PATCH_SIZE/2), int(j+PATCH_SIZE/2)]\n",
    "        if target == 0 :\n",
    "            continue\n",
    "        else :\n",
    "            image_patch=Patch(X,i,j)\n",
    "            #print (image_patch.shape)\n",
    "            X_test_image = image_patch.reshape(1,image_patch.shape[2],image_patch.shape[0],image_patch.shape[1]).astype('float32')                                   \n",
    "            prediction = (model.predict_classes(X_test_image))                         \n",
    "            outputs[int(i+PATCH_SIZE/2)][int(j+PATCH_SIZE/2)] = prediction+1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAATkAAAEyCAYAAACBJqcyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAWd0lEQVR4nO3df+xddX3H8edrRVBUpB0rq7SuuDCXuszpGlbUGGP9wSyhLBlJyVjqbNMsOIdui7SSjOwPkjqN02Tplm8KUidCGsTRgL861JglK9qiaEvBFsHylUphZrjMBa177497vvT29txf55x7zzmf+3qQcu895/54f3+98zqfz/mhiMDMLFW/UncBZmaT5CZnZklzkzOzpLnJmVnS3OTMLGlucmaWtIk1OUmXS3pU0lFJWyf1OWZmg2gS+8lJWgR8H3gHMA98C7gmIh6u/MPMzAaYVJK7FDgaET+IiJ8DdwLrJ/RZZmZ9nTWh970IeLLr8TzwB/2eLF0QsHJCpZRxAPj9AetsUl7xilfVXcLYnnvu2GmPL/jtmgoZwbOP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XA/cDbuppc3TWdlzUU9SyvrS5OnZV6CZ2d3O/N/oBrqQlY2dNMcuvo/X3P/rAvm1ZdPev+CLh92nXl1QTcBbwOeKKryRWqqQmbqyOfMn1aJK0EXg88AFwYEccBstul/V85EZ+gcy2N/+taVndNrwaeAT6VbUbvlPTSOuuKiB8BH6NzYaXjwHMR8ZU6a+rRr44m/f6/F/hidr+2uqq4vEK3JjS5kU+ZPg2SXgZ8DvhARPy0rjqyWq4ATkTEgTrryHEWnU2Mf4qI19M5JK+WsdQF2RjXejqbMa8EXirp2jprGlEjfv8l3QicBG5fWJTztInX1XV5hb/NW52zbGhNTWhyjTlluqQX0Wlwt0fE3dnipyUty9YvA05MsaQ3AVdmZ1++E3ibpM/UXBN0fmbzEfFA9vguOk2vzrreDjweEc9ExC+Au4E31lxTt3511P77L2kjcAXwJ5FtB9ZYV/flFZ7g1OUVfr1oTU1oct8CLpF0saSz6Vy3dc+0i1DnghW3AIcj4uNdq/YAG7P7G+mM1U1FRGyLiOXROTHpBuCrEXFtnTVldf0YeFLSa7JFa+mcDbrOuo4BaySdm/0s1wKHa66pW7869gAbJJ0j6WKmfMkASZcDNwBXRsTPeuqdel0R8b2IWBoRK7Pf+3k6E4I/LlzTpAY4xxx4fDed2czHgBtrquHNdKLvd4HvZP/eDfwqnYH/I9ntkprqeyunJh5qrwn4PWB/9v36V2Bx3XUBfwc8AhwE/oXOLNzUawLuoDMu+Ivsj3TToDrobJ49Rmdy4g+nXNdROuNcC7/z/zzNuvJq6ln/BNnEQ9GafMSDmSWtCZurZmYT4yZnZklzkzOzpLnJmVnS3OTMLGlucmaWNDc5M0uam5yZJe3/ASVWZpuJNQ9wAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Plot the Ground Truth Image\n",
    "ground_truth = spectral.imshow(classes = y,figsize =(5,5))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAATkAAAEyCAYAAACBJqcyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3dfaxk9X3f8fe3EOzgBwGl0DWLCo6oIxw1NaUwTirLCklMc1deKgUJK442DbOret3UTVuFJRa1qgiVNJGb/LOudsdOti0BrQgJaG8Sm5C4VqXO2oBjhwdj1sGBNWvWrps+JXKC++0fc87cc8+cM3PmPJ/ffF7Sau6cMzPnt3Pn/uZzfk/H3B0RkVD9ta4LICLSJFVyIhI0VXIiEjRVciISNFVyIhI0VXIiErTGKjkzu9XMnjezM2Z2pKnjiIgsY02MkzOzC4AvAz8CnAU+B7zP3Z+t/WAiIks0leRuAs64+5+4+18CDwL7GzqWiEiuCxt63auAlxP3zwI35z3YzDTtQkTK+qa7/428nU1VcpaxbVdFZmaHgEMNHV9ENsefLtvZVCV3Frg6cX8v8EryAe5+DDgGSnIi0pym2uQ+B1xnZtea2UXAHcCjDR1LRCRXI0nO3V8zs38KfBK4APiEuz+zxissbJlyEIDReLx7xyRq6vPZGfLUZvtHHJ8/ZDyd7ZuMVgXG9Fn2ssdnnZEnjKeL2yajFceX2NbW0QpP3s7evr1V/jUL2N4+vOt+/BGY5LZGVzM+vXz/ZJLxGZzv3JzPYlOnq7j77wC/09Tri4gU0VglV7d5MpvMbubJLu60jZr14u+nnf3Ha05wFWSlO9iob9VWNZzc+ipOcOPxaNf9TdXIYOC1C7HQ8bDkdDVxGlrDkTO3Tlk85S363Lm8Cq2oDa34Kp2mdix9utrUd2VMp6tzT7r7jXk7NXdVRII2vNPVlOKdCkl5KWz3KW8lZb4pk+kvnQTD+uaVBqw6LR2PRxt56qokJyJBG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]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Plot the Predicted image\n",
    "predict_image = spectral.imshow(classes = outputs.astype(int),figsize =(5,5))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
